﻿using System;
using EmailJabber.EmailJabber.Core.Entities;
using EmailJabber.Logic.Commands.Base;
using EmailJabber.Logic.Logic.BusinessLogic;

namespace EmailJabber.Logic.Commands
{
    public class EmailRecived:CommandBase
    {
        public static Guid ID =  new Guid("A69DEBBD-49AD-42D1-B9EB-4930D60CA33F");

        protected override string GetDecription()
        {
            return string.Empty;
        }

        protected override Guid GetId()
        {
            return ID;
        }

        protected override void ExecuteSafe(MessageIM comnd)
        {
            LogEntry logEntry =new LogEntry(comnd.Body,DateTime.Now);
            BL.Instance.AddLogEntry(logEntry);
            BL.Instance.SendAutoNotification(comnd);
        }
    }
}